using UnityEngine;

namespace player
{
    public class AnimationTrigger : MonoBehaviour
    {
        Player player => GetComponentInParent<Player>();

        // ========================================================================

        public void OnAttackComplete() => player.ChangeState(StateCode.Idle);

        private void AttackTrigger()
        {
            Collider2D[] colliders = Physics2D.OverlapCircleAll(player.attackCheckPoint.position, player.attackCheckRadius);
            foreach(var hit in colliders)
            {
                if(hit.GetComponent<Enemy>() != null){
                    hit.GetComponent<Enemy>().Damage();
                }
            }
        }
    }

}

